<template>
    <div>
        <van-grid :border="false">
            <van-grid-item v-for="item in alldata.values" :key="item.stitle" :text="item.stitle" :icon="item.icon" @click="openList(item)"/>
        </van-grid>
    </div>
</template>

<script>
export default {
  name: 'quicknavigation',
  data: function () {
    return {}
  },
  props: ['alldata'],
  methods: {
    openList (item) {
        //console.log('=============================================================')
        //console.log('item:' + item)
        if (item.idobject === 'flowclmx') {
          this.$router.push({
            name: 'flowlist',
            query: { idobject: item.idobject, actiontype: 'mytask', actioncode: 'unhandle', stitle: item.stitle }
          })
        } else if (item.idobject === 'report') {
          this.$router.push({ name: 'reportlist', query: { idobject: item.idobject, stitle: item.stitle } })
        } else if (item.idobject === 'bizcalendar') {
          this.$router.push({ name: 'bizcalendar', query: { stitle: item.stitle } })
        } else if (item.idobject === '') {
          location.href = item.navurl
        } else if (item.idobject === 'bflx') {
          this.$router.push({ name: 'bflxlist', query: { idobject: item.idobject, stitle: item.stitle } })
        } else if (item.idobject === 'jhgl') {
          this.$router.push({ name: 'jhgllist', query: { idobject: item.idobject, stitle: item.stitle } })
        } else {
          this.$router.push({
            name: 'list',
            query: { idobject: item.idobject, idtemplate: item.idtemplate, stitle: item.stitle }
          })
        }
      }
  }
}
</script>

<style lang="less">

</style>
